package com.ruoyi.project.thirdservice.controller;

import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.thirdservice.service.GankDispatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yan
 */
@RestController
@RequestMapping("gank-api")
public class GankDispatchController {

    @Autowired
    private GankDispatchService gankDispatchService;

    @RequestMapping(value = "/data/{type}/{num}/{page}", method = RequestMethod.GET)
    public AjaxResult getData(@PathVariable("type") String type, @PathVariable("num") Integer num, @PathVariable("page") Integer page) {
        Object data = this.gankDispatchService.getData(type, num, page);
        return AjaxResult.success(data);
    }
}
